Complete the initial re-write

Note: setup script is outstanding