Update model imports using sqlalchemy.sql.* so PyCharm quit complaining.
Fix all broken formatters specs due to Mako changes.

This updates all template-exposed formatters and passed in context and
request in additional to just the string. By using explicit passing of
request, this means we no longer have to rely on `get_current_registry`
for generating dates and such.