(Bug 49169) Draft: Check all tex commands before passing them to renderer

This is just the demo that uses the texvc source. It would be
preferrable if the functin would be implemented in php. See the
discussion in the bug report.

Bug: 49169
Change-Id: I9e4b22b3f08317b7221c4d279e717d18ddb7966b