Allow using mapnik tokens in SQL queries

The code replaces the tokens for the purpose of sending the query
to the SQL api. Tokens are retained when interfacing to tiler.