Improve various quality metrics

- reduced cyclomatic complexity on {to,from}_rgmlgraph below 10
- improved pep8 compliance
- tools used: pep8, pyflakes, pylint, pygenie, pymetrics