Refactor tests; clean up example