Set DYLD_LIBRARY_PATH when running tests on OS X.
Use 'close' rather than 'fdopendir' in the errno test.

'fdopendir' is not available on OS X.
Merge pull request #145 from yallop/macos-test-fixes

Macos test fixes
Introduce a 'bind' function for constructing C ASTs.
Normalize the AST during construction.
Capture some invariants in the C AST type.

The RHS of a let binding cannot be another let binding.
Return is now only allowed in the final position.
Only globally-bound functions can be called.
Distinguish global functions from variables in the C AST types.
Pull out local variables as a separate type.
Name the type of C bindings (x = e).
Merge pull request #146 from yallop/generate-normal-form

Represent generated C code in normal form
WIP.