Added terrain information, local tile id and fixed coordinate conversion

Some changes to fix things we encountered while using STI for our Gamejam project. :-)