Fix tests so the ant build properly fails when a test fails. This was keeping our continuous integration from reporting test failures. Also tweak emulator check to work more reliably.