Added support for passing custom variables to the controller. Closes #9 and #3