Improve speed of partitions

See mailing list discussions:
http://lists.racket-lang.org/users/archive/2014-June/063126.html
http://lists.racket-lang.org/users/archive/2014-June/062822.html