[WIP] Chapter refactorings

- [ ] Remove shelling out in the test suite against the binary
- [ ] Make command and arguments mapping cleaner
- [ ] Add unit tests
- [ ] Move chapter logic out of the main app defintion