Refactored tests and added build.xml