Huge refactoring and code polished. Fixes #3, fixes #7, fixes #8. Line Coverage 97%