Check for `syntax-propertize-function' when defining syntax-table

In pre-24 Emacs which lack `syntax-propertize', syntax parsing of
strings and comments can be done by the normal syntax-table mechanism,
which works OK except for the corner cases.
Replace ad-hoc scanning with syntax-propertize-rules