Moved new pieces to common

The constants and functions will also be used in tab-complete.c and
possibly other places, so move them to where multiple things can use
them.