Initial commit.

Code is much as written in 2004/2006.