Refactor panel collapsable group javascript to allow for animations