Revert "Make paths.js work in the browser"

This reverts commit 0e79551d84fa882d895e3902e3d7c63572f5c20d.

The commit introduced several bugs and was unclean