introduced sql template
introduced escaping
tests for sql template and escapes