Fixed map conversion to use Nashorn extensions to wrap underlying map and added tests