Rewrite README, fix up code a bit.