Adding alter function, documentation, and tests.

This is in response to issue #89.

It probably makes sense to add other functions eventually as well, but I'd like to keep my first patch as small as possible while being complete.