Cleaned up some code and added texture loader function to ModelObject.