Making things work both for nodeJS and javascript inside browser - ONGOING not fully functional