Initial commit.
Roughly working. Needs comments and further explanation of the options.