Cleaned up some API, and provided more package level documentation