Added new code

Plugin support, Handlers instead of dodgy ass code!