It's on the very bottom of this page and is very easy to overlook: Email Scripting » Marketo Developers
Thanks so much Kristen. I wish I saw that earlier, that would have saved me some time.
Sanford Whiteman here's the sort functionality I was struggling with last year! Now sort is supported, this become much easier.