Break out a demangleType function to handle DMD's new JSON output

The JSON output since the latest releases contains mangled type names and demangling with `demangle()` fails as soon as a type is not a symbol. This pull request just breaks out the existing type parsing as a second public function `demangleType()`.

See also D-Programming-Language/d-programming-language.org#267