Managing complex object inputs with wrapper classes in JavaScript