Moved most plugin code to autoload