Rewrite of the code generator and major parts of the Streamy runtime library. Initial import of this work into a branch.