Starting on the encoder

Almost to the point were i can start testing all the changes. Though i
still need to write a GUI, and finish the program handler.