[core] Fix #1, implement require.paths correct and write tests.