Reduce variable scopes

Also reduces some boolean logic verbosity.
JSResolver: read duration as signed integer
JSResolver: avoid unnecessary calls, simplify logic, consts
Resolvers: Remove useless assignments
JSResolverHelper: Fix typo in accountId() function name
Avoid copying of constructor results
JSResolverHelper: Make use of helper functions
JSResolverHelper: comparison function: pass QVariant by reference
Merge pull request #270 from lorenzhs/misc-fixes

Miscellaneous cppcheck and other fixes