Documented exceptions, improved some error messages, restructured packages into base types and implementations.