Further numba speedups; incidental bugfixes

I was able to squeeze out some marginal speedups in the refine code; see #45. Along the way I enhanced try_numba and fixed some bugs in the tests and in `refine()`.