Removing window and document references

This makes it possible to build mustache templates.