Cleaned up background.js. Fixed some page action issues. Fixes #215