Speed up save_hdf5

Speed up `save_hdf5` (hopefully) by using slice syntax, where possible.

Based on PR #468.

@markkness : give this a try?