Feature/opt2

Some more optimizations - slightly more risky. I've reworked some of the code to save a few hundred bytes. My rotary encoder is broken for the time being so I've not been able to test all of these changes.