Final part of S16 rewrite

S32/IO to follow soon.