Detached pages from XML courses are set to appropriate descriptor class ...

...(LMS-2094)

Add tests

Fixes an issue were detached items from XML courses were being turned into HtmlDescriptors instead of their appropriate category descriptor.

@cpennington , in the course of rebasing, there seem to be other changes to xml.py. Does this look okay?
@wedaly 
@singingwolfboy 

I'd like to hotfix this branch with the commit from https://github.com/edx/edx-platform/pull/2375, once they are approved