Initial commit, mostly literature, some template matching code, and other things.