Amended to be compatible with Dancer2

Updated the plugin as per the Dancer2 documentation to make compatible with Dancer 2