Allow standard promises to work in ajax mode and add ability to return data instead of promise.
Fix bug with empty array.
Oops, missed this change in the commit.
Merge pull request #63 from cthrax/master

Allow standard promises to work in ajax mode