Made box things not spawn close to each other.
Made getEntity return the closest rather than first-found in an area.
Got rid of useless bitfiddling.
Make sure the Level exists before we try to modify it.

This solves one source of segfaults.
Break out if we end up in an infinte loop as the RNG is #rekt.
Revised look-breaking logic because coding before bed is bad.
Fixed condition again because reverse logic is hard.
Merge pull request #1 from tsjost/master

First batch of bug and crash fixes