move msgtools to top level