Added another check on the device name to ensure it is not blank.
Move registerToken/UnregisterToken to WPComXMLRPCApi