Moved many things around.

Also added a partially implemented semi automated static variable cleaner..