Performance improvements for MySQL query generator

Change important MySQL query generator functions from using _.template to string concatenation. This has a large performance impact when doing many queries and having big result sets (attributesToSQL function).

We experienced a 20-30% performance boost when doing queries with large result sets in parallel.