Replace CmdArgs with Optparse-Applicative for CLI

Tried to minimise actual internal changes but it's generally
been a cleaner outcome in any case.
derive functors for script stuff
remove redundant import
fiddling with image map parsing
unnecessary indirection in parser state removed