Split out library and tests.

Rewrote Makefile to generate library and link that into the standalone
compiler. Put include files into a proper include directory. Also
compiles and runs a unit-test binary. Also does debug better.
Add some tests for the trampolines.
More work on testing.

- Add tests for public API.
- Add TODO test files for some other things.
- Fix some issues that were caught by the tests!
Add tests for functions and user types.