WebInterface: last changed for statemachine now uses HA date formatting
Core: Cache external method in local variable for speedup

(inspired by browsing through Python source)
Bus and StateMachine are now thread-safe