Added handling of closing the engine

Added handling of closing the engine.
Added some properties to Media for file handling.
Added calling of ZTimer OnStart and OnStop.