Code optimization on functional simulator

Improved the code for the functional simulator some, made it more “Swift-like”. Also used the new “stats” feature of the functional simulator to make a slight optimization to ldi16.?, it was doing an extra memory read that wasn’t required, so I eliminated that and all tests still pass.