Merge pull request #82 from yenatch/master

Rewrite scan_includes.py. Add include paths.
BSSReader now reads constants and variables.

This lets the map editor do cool things.
Fix the map editor.

The map editor can now be invoked in ipython:
	import extras.pokemontools.map_editor as ed
	app = ed.init()
Then <app> can be modified on the fly to make up for lacking functionality.
Also see app.map.crop().

Now works with all maps in both Red and Crystal.

The version defaults to Crystal. To use with pokered, invoke from the command line:
	python extras/pokemontools/map_editor.py red

Or in ipython:
	import extras.pokemontools.map_editor as ed
	app = ed.init(version='red')

Also displays connections, but they're unaligned.
Merge remote-tracking branch 'origin/master' into fix-map-editor
map_editor: Fix automatic graphics decompression.
Merge pull request #83 from yenatch/fix-map-editor

Fix the map editor.
Fix the output of PointerLabelParam.to_asm.

Accidentally forgot to zfill either half of pointer_part, which would return malformed addresses.

Fixes de39f7c6ff487f02d1914cc4a3260817287207c5.
audio: Expose header reads via separate functions.
Refactor the de/compressor.

Speed, readability, accuracy and compression are all improved.

Also fix an off-by-one error in repeat commands in the compressor.
BSSReader: Fix eval inserting __builtins__ into self.constants.

Eval should really not be used in the first place, but at least it works again.

Fixes 82b78e5c7969aebb797f35a58577dd0afb2c2f38, which replaced the constants_to_dict method with BSSReader.
More lenient palette handling.

Truncate colors in a palette beyond the limit of 4.

Make palette sorting more accurate by taking the sum of the hues rather than by luminance. Ultimately, palette order is up to the whim of whoever was drawing in the tile editor at the time, but this is a reasonable estimation.