Implement integration tests and fix error code

- Initial implementation of integration tests.
- Mycha now returns status code 1 when tests fail.