Don't calculate twice--save and reuse the result.

This was actually my intention, but somehow I just copied and pasted the
expression and completely forgot that I had assigned it to a variable. I have
no idea what I'm doing.
Only invokable profiles can be invoked.
Don't rely on hash ordering [1].

The profile was previously contained in a hash, mapping the name to an array
of its devices. Obviously, there is no guarantee that we iterated in the same
way that we added. In other words, what happened was not a top-to-bottom
parsing of the configuration file, but more like a random parsing.

[1] http://qtmemes.tumblr.com/image/20282967408
The Great Refactoring(TM).

I am refactoring pretty much everything here. The decision was made to make
testing easier, which I realized was necessary. At the time of writing, I have
coverage for almost everything.