Adding a non-protobuf allocate_ids method on Dataset.

Partially address #336.
`xrange` is gone in Py3k.