Use thimble

WIP, with some review points so it doesn't get too off-track.
+1

I would've argued this is not required but now I realize that above works under the assumption that `self._state` does not contain valid non-True value :). What if `ALLOCATING` was 0?