Move all local function prototypes to the top of MMDB_Core.c so we can order them sanely

Also wrote a tool to regen the prototypes so we don't have to manage this by hand.