Use a common module for setting flags and allow tools to be compiled alongside MCServer

FIxes #671