Implemented secure calling and error handling of base Metalframe files

Also fixed a few bugs inside of the code that kept it from running