Added asArray helper to base model
Added Model base tests
Moved bucket tests into model namespace
Updated viewer to be the new query interface
Updated tracking to use new jsonError format
Fixed bug where sorting was wrong in query interface