Refactored CLI and bin

That's a bad practice to put logic info `bin/` of gem. Let's move it into separated class.