Starting some unit tests and fixing crash when `new` is omitted

It fixes #20 and starts adding tests for the bits we don't need devices for. I'm thinking later we can move some of the current tests into an examples directory.