modified to better work with chrome app:
- instead of logger, use console.log or debug, error, warn, info
- window.Components instead of Components
- storing host_keys in localStorage if on a website.
- removed the need of observer.