Fixed "ENV is undefined" issue in addon/lib/document

Resolves #31.

A simple matter of switching to using the `config` object instead of relying on a global `ENV` variable. Part of #14, but was missed when resolving that task.