Make project_list generic.

So we don't need to duplicate code.

Note projects_by_cap_used is still completely broken, despite the fact
we got rid of the error. List is empty.

Change-Id: I83be06d74627eaa4fa61ecf690dc6ec491462989