Allow running in development mode without an Arduino on hand

Here's a round of small changes that accomplish the following:

* Setup automated testing so I can safely refactor
* Refactor to improve the organization of the code a bit in preparation for the dosing feature we dicussed
* Make the serial port configurable, and, in development mode, configure a stub that only logs what *would* have been sent to the serial port instead of actually opening it, so I can work on my laptop
* Along the way, fix a couple of bugs

You can see more detail in the commits.  If it's helpful for you to follow along, I can walk you through them next time we meet.