Fix machine_category mess.

Remove may assumptions that there is only one machine category per
project.

Still needs to be fixed:

* xmlrpc methods.
* applications.

Change-Id: Ic312bc4035c0048fe0414c067626140816e28178