Add partial support for rate limit, change CLI interface to flag based, cleanup