Added support for using template with WHERE already in it

Many times, I have a template with a lot of WHERE already there, and want to add stuff dynamically.

This adds a flag so you can specify that the template already has a WHERE clause, so the dynamic where's are connected with AND instead of WHERE.