use string interning to reduce memory usage

This also gives slightly faster map accesses since they're now just
integer keys.