Added test cases and SQLite database stuff