Added tests, corrected errors, implemented SqlResult class