Make webpack-compatible through function-local require function

Fixes #18