Refactored code to make it all a little cleaner. Began adding object inheritance to types.