Rewrote SQLite library.

Also deleted all those ~ files that were floating around for some reason