Refactor expensive operation into standalone function.

Rename a couple more variables.
Automate pip install -r requirements.txt when dev reqs are installed.
Add test for expensive function with typical output.

Instead of bothering to hand-craft a unit tests, I went the route
of the fantastic ApprovalTests library/libraries and just serialized
known good output to compare to at a later time. Besides being quick
and easy, knowing what is different between expected/approved and
actual/received output is as simple as doing a diff between
directories (or just the files of interest).