Tweaked test helper functions, added tests for most stats queries
Added test data to resources directory to support views-test namespace