array and object literals should be collapsable the way functions are

Make js2-mode-toggle-element and js2-mode-hide-element handle array and object literals, plus a little refactoring so that they don't both do the same work.