sort out registers and add extra unit tests for add-variable-elwidth