update samples to be compatible with chrome ext  manifest_version=2

Refactored inline JS and updated manifest.json