More work on integrating compiler and simulator

    Added a psr and machine control register
    Miscellaneous fixes
Merge branch 'codegen' into codegen-CPP