Ticket 17758

This is a complete re-integration of the work that was previously done by lrekucki and tmitchell; I've posted in the trac ticket as well.

I've updated all of the tests for trunk (no 2.5 support, python 3 support through 6, accounting for parts of their branches which have since been merged into trunk, or which are no longer needed). It's much cleaner than the original development line.

All tests pass on Python 2.6.7, 2.7.3, 3.2.3, all with and without hash randomization enabled.