Update manifest to version 2

Move all inline javascript to their own files, to ensure they still
work. (This change is required for the new manifest version).