TODOs, comments, typos, path handling, some refactoring. 3rd round.