Moved functions from map.php to functions.inc.php .
Added CSV output.