Refactor testing to work on both iOS and OS X

Closes #30
Fixes #34