Code completed.

Comments to be added, tests to be done, demos to be written, readme