Added integration tests for ranges & counts

Added 2 integration tests for ranges and counts. Feedback awaited. Created this as a diff pull request as the branch is diff.