require() in module

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
asString(QJSValue)

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
[actor] endpoints handling refactoring

Endpoints are passed as a single object with on_{reply, error, progress}
methods or just a callback function to be called as on_reply. Endpoints
are stored on the caller side to be removed in the thread they was
created in.

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
[env] wrap any exception into Error

class Error maybe coming from QtScript is the only one considered by
QJSEngine as error when exception is thrown :p Otherwise exception just
becomes a normal return value :/ So, to avoid invasive modification of
QJS* executed code is just wrapped in try/catch wrapping any exception
in Error object (.isWrapped and .originalError can be used to understand
is it wrapped and what was the original error)

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
[util] better QVariant->QJSValue conversion

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
[env] generic error conversion code

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
[actor] proper error processing

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>
[examples] updating to new interfaces

Signed-off-by: Denis Zalevskiy <denis.zalevskiy@jolla.com>