Added a manifest check in the www/ directory.

This is where the manifest is located in cordova Chrome apps.
Also refactored to remove duplicate code.
Merge pull request #3387 from mwoghiren/www_manifest

Added a manifest check in the www/ directory.