Add code emission for library format

Variables are not supported.
Fix typing.ml

Add option to enable top-level unit-type-checking
Fix main.ml to correctly check types

main.ml no longer change bool to int