Multiple device support

Fixes #54.

This provides basic support for multiple devices. It isn't styled correctly yet but in the interest of making testing easier, I thought that could wait for #85. There is some extra noise in this PR because I normalized some whitespace differences.

@pdehaan r?