Rewritten all classes.

Started again on most classes to make the program read easier.