checkasm: Use a self-balancing tree