Add unit tests for compiler

These unit tests should be able to run on OS X.