Order Events by time/data fields.
Events can be ordered by the time or any of its data fields by adding an 'order=field' parameter to the query. 'order=-time' is the default.
Descending order can be specified by prepending "-" to the field name.
If the ordering field is "time" the field name is transformed to "t", otherwise it is transformed to "d.{field_name}".
Fixes #79
(Resubmitting with the correct git user, sorry for the noise)
I'm not much of a JS developer so it took me some time to wrap my head around all of the callbacks in the unit tests, but I managed to write some tests for events. The tests even exposed a problem in my pull request.
Is there anything I might change with this PR to help it get merged?