Magic and tilesets

Added basic magic system with mana and 1 spell. Also incorporated
graphical tileset framework (in tiletest.py). New version of library to
fix certain graphical glitches.