Reissuing #3 to push tests through newly added travis.
As these parts are a separate logical block I extracted them to separate funcs to:
simplify main func
name these blocks (form of documentation)
improve possibility of unit testing
Feel free to change their name (e.g. to prefix them with underscore) or/and add docstrings.
Please also add unit tests which will describe intention of author how they should work and will be in the same time a blockers for future potential regression.
This looks great, thank you.
One last thing that I would ask of you would be for you to add yourself to AUTHORS.md file that I commited into contributors section.
Reissuing #3 to push tests through newly added travis.
As these parts are a separate logical block I extracted them to separate funcs to: