applying fixes from nme-tilelayer
test, debug rotation
Merge pull request #1 from elsassph/master

Rotation fixed, added test case