Add a few new tests for WebUI

- added tests for Tomcat and PostreSQL services
- added tests for upload/delete agent template, ui file
  (and download appropriate file)
- made some refactor

Change-Id: I92967abc061d609adb6aab1e1b93e66bcd43795b