Refactoring, GM API, History fix

Refactored some variable and setting names.

Using the GM API now to save settings instead of using cookies.

Fixed 'History html and opening a new tab