Moved some redundant code to m_cmds.c

More work needs to be done here but this is a good start.
Cleanup quit -r so it works now.