Refactoring on the tile caching in the Machine Base, also added Sorting Machine logic (still needs testing, and is redundant atm).