Updated test class.
Added tests to suite.
Refactored QueryBuilder.
Refactored some prails methods.