Add a check for the php5-json extension (some Ubuntu based linux don't have it installed automatically). Reported by Mario.
Centralize some of the database function (linked to the normalized search). re #48, #49