Slight refactor of RegisterManager

Move register number determination into subroutine and call from get &
set register value methods.

Verified through unit tests.