Refactoring, cleaning up and bugfixes

Fixed a lot of onResume and Widget problems; changed several flags that
used integers to booleans, and cleaned up erroneous calls to
getParameters.