Cleanup

Cleaned up code a little, moved hardware setup to its own class, changed
parameters to arrays, reduced the number of event handlers