Implemented optional faster implementation of ids. Closes #315.