Move to Chrome JS API, fix indentation