creates and uses a cache to reduce the number of DB access
fixes test cases correctly based upon type changes
uses cache to get rid of unnecessary cursor iteration in basic_stats
adds test cases for check_login
adds addQuery function
adds more queries to TestCheckLogin test suite
adds removeQuery and changes refs