Improve CLI experience

- show helpful errors when the user does something wrong
- the file functions should be placed in a different locations, but waiting for @andreypopp upcoming PR before doing this
- not happy with the synchronous file handling, due to performance, but for now this will do