test isolation

incorporates #8 and #11 to fix #9.