BFS optimization - first steps

Made some progress. Just saving this version before I switch things
around even more... having a fallback is always enjoyable!
BFS optimization - more steps

Removed a few big variables... I'll have to get things working again,
but so far so good I think