stats.php: combine insertSite into lookupSite

In this case, it is less code, and more DRY.
stats.php: update schema to include configuration

This includes:
- country, language and timezone
- operating system name, architecture, version
- java configuration profile

This change also separates the user tokens into their own users table,
to avoid redundancy in the events table.
stats.php: use empty string for missing JSON value

Previously, we were using null. The problem is that MySQL needs a
special syntax for matching NULLs: "foo IS NULL" rather than
"foo = NULL". So let's use the empty string instead, which will match
using the equals operator like everything else.

Without this change, the lookup tables will accumulate another NULL
entry every time a value is left out of the uploaded JSON string.