Removed magic numbers and seperated project into multiple classes.

My code is now easier to read, is more flexible and is prepared for the
inevitable increase in complexity further assignments will bring.