Add exportlegends and logregion

Fixed version of #231 after restarting my entire dfhack fork.  

`exportlegends` how takes an argument to export everything (`all`) or just the detailed maps (`maps`).  

`log-region` was giving error messages, so I've added a check that only calls the script on loading a fort, not legends or adventurer - which it couldn't handle.