Clean document.js + add a few tests for document
Ignore .swp files