Revert "Fix syntax in sqlite method."

This reverts commit e9c55a5d48fd6bfde28c4049971c3aab1ec66c4f.
Revert "Database fixes and cleanup."

This reverts commit 19424f2eff045b7e1543e3219d50f532c096ba05.