Start converting Xhgui_Profile into a domain object.

Having a domain object that contains the logic that is currently spread
between the utility file, and the existing Xhgui_Profile class will help
tidy the code up. Having a domain object means future refactoring to
make the templates less painfully aware of the schema will be possible.
Update methods on Xhgui_Profiles to return instances of Xhgui_Profile.
Add methods that will be needed for printing lists of profiles.
Allow getting all the meta data as well.

The twig templates are much simpler when you can get all the meta data,
as the template code is `profile.meta.foo.baz` instead of
`profile.meta('foo.baz')`
Update templates for new methods.
Start moving code from global scope to class scope.

Basically a cut and paste at this point. Tests are still required.
Add tests for some of the migrated functions.
Tidy up method.
Move method into a closure.

This function is only used in one place, there isn't much point in it
being a public method at this point.
Use list() instead of 2 statements.
Add tests for calculateExclusive()
Don't mutate data, create new instances.

Mutating data gets a bit hairy. The exclusive calculation is still
not ideal as it destroys the original data structure.
Fix missing property being passed to exclusive profile objects.
Add _id to fixtures.
Pre-process data all the time.

Pre-processing data will make a few other functions simpler. Start by
updating getRelatives(). Since xhprof gives a fairly flattened list of
data, flattening it more won't really hurt.
Convert calculateExclusive to use new data structure.

The method is considerably simpler now that it isn't processing and
calculating at the same time. It also no longer destroys the original
data as it has already been transformed.
Update run.php to use new functions.
Merge branch 'refactor-global-functions'

Conflicts:
	web/templates/runs/url.twig