Initial chat command functionality + test

-- refactored keygen to model