Convert JS Objects to ES6 Maps and vice versa