Bugfixes, refactoring, starting blacksmith gui

- Small AI bugfixes
- Added a generic adjacent tile entity cache object.
- Number of other small refactorings
- Started working on blacksmith gui.