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 #(2-7) PRs that should be reviewed separately.