Managing information in JavaScript