Initial commit

First code ported from Wonderflux - work in progress.