Speed up save_hdf5

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