Refactor shifter circuits and tests.