qtjs patches

This is a work-in-progress PR, only for preview of the features planned to take out as separate PRs until this one is empty.

Also, it depends on the current #(1-6) PRs that should be reviewed separately.