Improve placeholders and prepared statement handling

This adds support for '??' escaping as per issue #60.  It also greatly improves the performance of prepared statements with more efficient parsing, avoids multiple parsing passes of the same statement, and removes unnecessary lookups.