Initial commit. A bit hairy.