Move type declarations closer to where variables are first used
Move type declarations closer to where variables are first used

Where possible I combined them with assignments.

maxmind/libmaxminddb,maxmind/libmaxminddb,maxmind/libmaxminddb