Reduce variable scopes

Also reduces some boolean logic verbosity.
Remove break after return, it is redundant
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: avoid unnecessary wrapping

Please check that this is, in fact, correct!
JSResolverHelper: comparison function: pass QVariant by reference