Use new plugin hooks.

fixes #5
Changed smarty template to Twig

refs #4
Converted code to use namespaces and new classes.

refs #4