Added functions and comments to viewer.js.
Cleaned up swap files.
Merge pull request #1 from StevePavlin/master

Martin