Added attributes to plugin as this is required in later versions of hapi. Some refactoring.