issue #36, maybe issue #51? support for relative urls based on source url

Fallback to source url done only if window is defined (if in browser).  This worked in latest chrome.

cake test passed (i think, it hangs after it passes all the tests)
cake bundle generated results different from what is in github, so I added my changes by hand.
cake bundle:min failed to run due to `minified = uglify(data);` `TypeError: object is not a function`
cake docs was also failing, so I added the change in comment to that by hand.