Add explicit export lists to modules

Also add some documentation and clean up compiler warnings.