Implemented scheduled shutdown.

Added libraries joda-time and cron4j.