Added optional cache argument to new() to speed up look-ups