Add escaping of pk and fk property names

Fixes #861