Allow self-nesting of depth > 1

Resolve #9
Fix lint errors and add flake8 to CI