Add `loadFunOpts` to allow setting of C compiler options
Add documentation
Cleanup
Remove `unsafeLocalState` from `ref` and `to`