Tidy build script, and make work on WLP & TomCat