Refactor and apply some fixes.
Readme, fix comments.