shill: wifi: Load hidden services from storage

When a device or profile comes into existence, the device
will search the profile for hidden services and instantiate
services if they do not exist.  These services will not
be visible in the RPC service list until they either appear
in scan or are actively being connected.

Side effects:
  * Manager now loads the devices with profile data.
  * Manager now respects the "powered" attribute loaded by
    devices from the profile to determine whether or not
    to call Start() on them.
  * Key files can be searched for groups with a certain
    key.  This will be useful when we start supporting GUIDs.
  * On service registration go backward (from top of stack
    downward) through the list of profiles searching for
    configuration instead of forwards.
  * Move the update of the "Services" property of the manager
    to a more centralized spot in SortServices.  This way,
    when the service order changes (or anything else that
    affects the service list) this RPC property will update.
  * Hidden services are not scanned for if they are in the
    ephemeral profile -- it means that whatever profile was
    supporting them does not exist anymore.
  * WiFi services have the unenviable task of also decoding
    storage identifiers in order to glean the address, mode
    and security parameters.

BUG=chromium-os:22073,chromium-os:22074
TEST=New unit tests, Manual on real hardware.
Note: I could not connect to a hidden network, but this
is because we're not setting the ApScan parameter on
wpa_supplicant so on connect it is just doing broadcast
scans.  However if I seed the profile with with a record
containing a hidden SSID, shill will force a scan for
the hidden network, which will allow it to connect.

Change-Id: I97a5b5f6db7c6e6d2aabf212c5c2984ce7f4daaa
Reviewed-on: https://gerrit.chromium.org/gerrit/11558
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/profile.cc b/profile.cc
index f922d39..4dd98cb 100644
--- a/profile.cc
+++ b/profile.cc
@@ -137,11 +137,15 @@
   return service->Load(storage_.get());
 }
 
+bool Profile::ConfigureDevice(const DeviceRefPtr &device) {
+  return device->Load(storage_.get());
+}
+
 bool Profile::ContainsService(const ServiceConstRefPtr &service) {
   return service->IsLoadableFrom(storage_.get());
 }
 
-bool Profile::IsValidIdentifierToken(const std::string &token) {
+bool Profile::IsValidIdentifierToken(const string &token) {
   if (token.empty()) {
     return false;
   }