Allow ids to be either strings or integers

Closes #372