Added build.xml for ant builds.  Also some refactoring