Refactor, documentation, improved README