Multiple Core System Upgrades

Changed the ENV constant and added to the $GLOBALS variable. Finished
Test suite. Upgraded and cleaned the Model class to work faster and
added very useful comments throughout.