Redesigned the basic layout of everything and moved everything from designer
generated code and added some output functions.