Check for existence of "document" and "navigator" before referencing them

* Allows requiring the module in an environment without a DOM. Thus
permitting to late inject a `document`.
Merge branch 'pr/28'
Removed Cookies._navigator
Allowed exporting to environments without a window

When a global/window object with a `document` property is not available,
Cookies.js will now export a factory method that accepts an instance of
a `window` object.