Initial commit of prototype

Lots still to be done.