Fix TOC URL resolution and related function definition scopes in package_document.js
Merge pull request #12 from readium/hotfix/toc-url-handling

Fix TOC URL resolution and related function definition scopes in package_document.js