Add statement assembly functions

This PR introduces some functions for statement assembly.
Targets #284.
Please remove the `ws_` prefix.