Pattern implementation for SMARTS queries.

Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>