Refactor, clean, rewrite code. Update readme.