test_max_scan ala server jstest/maxscan.js

includes additional correctness mods for test suite

RUBY-676