Currently, this doesn't work very well except on Unix. Add tests to other platforms and fix any bugs.