core: monitoring - extract saveToDb and afterRefresh of VMs

Change-Id: I94bb7984b4767c434786320d5d08ae4dedf29e4c
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1099068
Signed-off-by: Roy Golan <rgolan@redhat.com>