Fix adding new category from group admin page

There was previously no function to catch and process the Ajax request.
More cleanup

* Lots of escaping
* Add missing text domains
* Remove extraneous call to the $bp global
* Fix https://wordpress.org/support/topic/warning-cannot-modify-header-information-headers-already-sent-22
* Move bp_group_documents_init to bp_include
* Better use of BP functions to help avoid calls to $bp global
* Lots of typecasting
* Unicorns for everyone