taking fetching of documentation out of global scope
delegating handling of promises to callers
updating doc blocks
refactoring places where globals where used
Merge pull request #39 from rushton/hotfix/issue38_javasript_async_error

taking fetching of documentation out of global scope