Refactor smart-home to a separate script and fix for wrapped lines

* Moved to a new script smart-home.vim
* Refactored wrapped line handing to solve several issues