Used ServiceLocator mechanism to load freemarker template engine
Added a guarded lock to reduce the average execution time of testScheduleEvent