Added some comments and made some code changes
Made plugin loading code fancier