convert multiple if statements to guards
cleanup whitespace and improve error messages

- display reason for failure when getopts fails
refactor nested match statement

- rewrite to do a single match over tuple of nested match args
refactor cursor movement and remove tests

- take buffer contents into consideration when moving cursor
  * not complete

- remove tests. need to come up with a cleaner way to setup tests.