Moved some common function to interface.  Refs #7653.
Complete coding (almost).  Refs #7653.