Add activity_type_id to case_type api output

It's a hack for converting from an XML object to an array. When I was testing/patching it, it worked surprisingly well for key-value pairs and for some simple trees - but not for the list/array conventions in CiviCase (which is why I was patching). So I isolated it a bit but didn't completely remove it.