Added support for passing in locals to the template

As I mentioned in #12