Javascript: architecture - object literal