Prepare for using DB2 as Database backend.

This change prepares MathSearch to use rendering
engines other than mathWebSearch. UnitTests demonstrate
that DB2 can be used as database backend.

The integration to the user frontend will be a
follow up commit.

Change-Id: I4b947d7c7d37eb1409e7f3e57d9b1ff156b4c015