Converted TileExtractor to Scala... I think I'm going to rewrite the whole thing in Scala, but try to be more efficient this time.