Started working on proper alghorithm for require.resolve()