Refactoring, some doctests, main file renaming
Some refactoring