Allow standard promises to work in ajax mode

Also add ability to return data instead of promise.  Addresses #61 .