Reverse dependencies btw templating and services

 - Move interfaces from templating to services
 - Move BaseContext to services

The handlers package no longer depends on
the templating package after this change, which
is good.