Add primitive option to generate_all_slabs.
Automatic Py3k merge for testing