Handle undefined/wrong menu types and properly remove classes on close

Basically:
* Handle undefined/wrong menu types (line 40)
* Properly assign classes to elements (line 47-48)
* and remove classes on close (line 60)

Additionally remove closeOnClickInside as it was a carbon copy of closeOnClickOutside

btw sorry for the reformatting, my editor is configured to do so automatically