SQLite queries with placeholders.

SQLite queries implemented with placeholders, and sort string escaping issues out.