Added comments, sorted some functions so that all cache functions
are next to each other etc. No actual code change.
Make sure that the used bit of a profile is always set when updating
the cache bits (even though it probably doesn't matter, but that's
hard to understand, this way is cleaner).
Moved some class declarations into functions. Added comments.
Bugfix: addPersistent/addToCache would call Profile::merge(), which
deletes the original profile --> the profile accessed after this call
was invalid.
More documentation, and usage of typedef instead of std::vector<...>.