Added tests and moved code around to be in files specific to class they test