Simplify ident implementation

Remove some unnecessary/unused functions. Simplify the implementation to
pass around const char* (which is a little bit faster and also nicer in
gdb)