Trimming fixes

This addresses a number of issues related to trimming. Note that bounds-checking is *not* implemented during trimming, though a prominent note has been added to the docs.

The reasoning is that we cannot do the bounds checking in the python-centric case because numpy doesn't do checking by default.