XD-922 Stop AdminServer cleanly

- Fix AdminServer's tomcat stop() to run cleanly
- Added SingleNodeMainServer's stop()
- Updated tests
XD-906: Refactor aggregate counter resolution.

Create an enum for the package and use this in preference to Joda
DateTimeField. We don't need any of the latter's functionality
anymore and it can't be used for months or years.