Added a utils object with some useful common code

Working on consolidating things and refactoring old spaghetti code.