bluetooth: Works around the C++0x bluetooth.h issue

bluetooth.h uses 'typeof', which was removed in C++0x (it was replaced
by decltype() and declval(), but they have different semantics).

So if we want to use C++0x features, we have to work around this bluetooth.h
limitation.
bluetooth: Fix parameter verification according to API spec

The tests expect us to be more careful with that are passed as parameters
than we are at the moment.
bluetooth: Only create DBus proxies when the org.bluez name exists

In some cases, the name "org.bluez" may not exist in the bus, we should wait
for it to exist before we try to create a proxy for the tracked objects.

This is in preparation for allowing the name to disappear while the extension
is running, which may happen when we call SetPowered(off).
bluetooth: Simplify PropertyChanged handling

There's no need to wait for the 'PropertyChanged' signal before
sending the reply to the caller. BlueZ guarantees that when
'SetProperty' returns the property will be applied on the adapter (or
an error will be returned).

The 'PropertyChanged' should be used for monitoring if another
application has changed the adapter's state.
bluetooth: Add support for powering the adapter up/down

Tizen has a limitation that when the adapter is powered down, bluetoothd is
killed and the adapter is removed from the USB bus. Tizen also has a specific
API for disabling and enabling the adapter.

This allows for us to remove the workaround that we had, that we called enable
on the adapter on every initialization.
bluetooth: Add a real implementation for setPowered()

Now that we are able to properly deal with the Tizen issue that
the adapter disappears and bluetoothd is killed, we are able to
finally implement setPowered().
bluetooth: Fix using the "Name" property for devices

BlueZ exports two properties that should hold the name of a device:

- Name: the name that the device exposes, which is optional.

- Alias: an BlueZ-only concept, this property is always available and
  fallbacks to the address of the device if the device doesn't support any
  method of obtaining its name. If the UI choses, this property can be changed
  to something that the user finds easier to remember.

In some cases, mostly when dealing with older devices, the Alias property is
the only way to display a "friendlier" name for a device.

This also fixes an issue that when pairing with older devices, the name on
the paired devices list was undefined, if the device didn't had the "Name"
property at the time of pairing.
bluetooth-demo: Add support for enabling/disabling the adapter

This updates the demo with the setPowered() support that was recently added
to our Bluetooth API.
bluetooth: Fix trying to call non-callable callbacks

In case the user passes wrong objects in the 'onfinished' or
'onstarted' callbacks, we should not try to call them if they
are not functions.
Merge pull request #191 from darktears/power-refactor

[Power] Use new C++ wrapper in common/
Merge pull request #189 from vcgomes/bluetooth-fixes

Bluetooth fixes (mainly setPowered support)
[Time] Add getTimezoneOffset, getTimeWithOffset and fix get/set UTCs

getTimezoneOffset replaced getTimezoneRawOffset, this new one calculates
the DST offset.

Fix getters and setters of UTCs using getTimeWithOffset.
[Time] Change getDSTTransition return from undefined to null

Based on the tests:

TZDate_getNextDSTTransition.html
TZDate_getPreviousDSTTransition.html
[Time] Properly handle getTimeFormat