Changed implementation to use the low level interface for demangling.

Added a check for demangling errors, an exception is thrown in this case. The new implementation also does not allocate std::string until the parsing completes.