Fix issues with require.config()

This allows to reduce code duplication with `require.config()` (e.g. different paths everywhere) and for easier embedding in web applications.