Parameterized queries

Parameterizing queries makes them much faster from escape values, and improved readability.