Use hostname for determining if extension is active

Before it was using a weird top part of domain which was not reliable
and ended up with weird data in localstorage in some cases.

Closes #50
Rename function for clarity