Framework for assembling JavaScript objects