Simplify two complement implementation.
Correctly handle integer promotions and usual arithmetic conventions.

Other minor changes:
* Split the various kinds of operations. This allows us to type these correctly.
* Allow casts from a type to itself
* Insert casts before assignments (in the semantics)
* Insert casts before function calls (in the frontend, function calls are
  untyped in the expression semantics, so we cannot do that in the semantics)