Fixes

Those are fixes for a couple of issues. One of those was actually fairly serious in that it turns out the balancing code was completely wrong (really, what was that whole `balance = bool(left_subtree) - bool(right_subtree)` all about?).

Ah, I just noticed that you made a bunch of commits in the meantime, hope you won't have merging problems. I also see you changed the version number logic a bit. Not sure how important is that, but in any case, take into account that I just pushed my recent changes as version 0.4 into PyPI. Those do not account for your changes in the recent week or so.