Cleaned up implementation add global socket

Add global socket, clean up a lot of redundant code. Add ability to
remove plugins by making the plugin return :remove keyword.