Move errors into module.
Remove RateLimit class.
Remove unused imports.
Add license to source files.