refactore ant build (and add unit tests to build process)