Implemented SingleInstanceMonitor

SingleInstanceMonitor checks whether only one instance is currently
running. If this is a second copy, it's just closed and message is sent
to the first instance.
LifecycleObserver reformat.