Make math support (mostly) stand-alone