Rewrite background script

Rewrote the background script to behave more consistently.

Fixes #4
Fixes #9
Probably fixes #5
Rebuild as release build

Removes the map file references from scripts.

Fixes #11