Revert "Fix database query"

This reverts commit 0f77b9796ab49fe66a30ef7ea7df40e7f12fbb38.
Revert "Fix database error when id has a space in it"

This reverts commit 0a5f2f0b63bee760b8707dd91f277838b4c40280.
Revert "Revert "Fix database error when id has a space in it""

This reverts commit 326f1bad9cfd3ac6e8254d515e1e31eb26e48390.
Revert "Revert "Fix database query""

This reverts commit 134aa42184723b69ecb31ff9322ce0a2d9f59e0c.
Revert "Fix database query"

This reverts commit 0f77b9796ab49fe66a30ef7ea7df40e7f12fbb38.
Revert "Fix database error when id has a space in it"

This reverts commit 0a5f2f0b63bee760b8707dd91f277838b4c40280.
Revert "One database row per machine rather than for each time the stats are collected.  As the database got larger, the web interface was getting very slow.  This fixes that."

This reverts commit 932d34252cbdba530cc5a0dca7cddc6ecea80947.