Avoid allocation of visited array everytime through reuse
Cache the manhattan distance
Optimizing: ArrayDeque as Queue in bfs, avoid using iterator in isBox

Gives ~20% speedup in total
Moved VisitedNodes class to a separate file