Add a first pass at an unsupervised pretrainer.

Inspired by issue #39.