Code refactor; Cygwin support

- Refactoring the code made it easier for me to add support for Cygwin,
and the end result is much cleaner than it otherwise would have been.

- Changed `gnome-open` to `xdg-open`, which works on more linux
(and BSD) distros.

- Moved temp folder on windows from %AppData%\vim\tmp to %TEMP%\.

- Added comments and more linear whitespace for improved code readability.