workarround for stupid webOS bug

on callbacks from the service the returnValue
seems to always be set to true, no matter what
you set it to inside the service. So I transport
the success in another field, now.

Signed-off-by: Achim Königs <garfonso@tratschtante.de>
fixed wrong ref error in oncreateassistant.
added discoveryassistant

now discovery is seperated from create assistant
discovery is done during sync, if needed.

Big advantage: oncreate doesn't fail anymore,
i.e. account gets created properly and is not
left in some undefined state if discovery failed.

Makes debugging discovery *much* easier.
peacified jslint, only cosmetic stuff.
fixed possible future error in oncreate
re-enabled postPutRemoteModifiy in syncassitant

We really need that, otherwise new objects
get downloaded as duplicates to the device.
I'll fix the stupid patch (hope this weekend).

But this has to be enabled for us. Really.
If I want to disable it again someday,
please remind me...
changed CalDav.js to be more case insensitive

the webos XML parser can't convert everything
to lowercase. One issue with owncloud was
that it returns lower case stuff, but CalDav.js
expected upper case stuff (at least the D's).

That's now fixed. XML is now correctly parsed
case-insentive.
CalDav.js can now handle redirects.

Seems to be a very good idea for a working
discovery.
checkCredentials is now done with PROPFIND.

This is for stuff like owncloud, that would
otherwise just return the login page with
a status code of 200, i.e. credentials did
not get checked. Now wrong credentials are
correctly rejected before account creation.
peacified jslint
removed onCapabilitiesChanged service end point

We don't have an assitant for that...
and webos does not use it anyway, it seems.

From the docu, it does the same as onEnabled, only
a bit differently.
do not print password in the logs.
added OnCredentialsChanged assistant

This is necessary if we change user/pw from the
account app.
extracted getTransportObjByAccountId from discoveryAssitant

this is also needed in checkcredentials assitant
for already existing accounts (i.e. changing user/pw)
to get URL from db.
now credential changes for existing accounts works

for this checkcredentials needed to be adjusted
to possibly get a transport object from DB which
contains the URL.
some smaller fixes in discoveryAssistant
got rid of unlockCreateAssistant method.
do not attempt sync if config is incomplete

this was detected earlier... but control flow
did not end properly.
CalDav.js fixes

- fixed some possible undefined-access issues
- some whitespace fixes
- discovery changes.. this includes a hack for
owncloud, which should now work ok.

Basically discovery is a lot more aggressive now.
It will check the user supplied URL, the
host/.well-known/caldav and carddav URLs, and
tries to replace caldav/carddav from the user
specified URL. All those places are queried for a
user principal (i.e. webdav home folder).

On all the results and all the URLs we query for
addressbook/calendar-home-set, i.e. root for contacts
or calendars...

If we find the home-set, sync will normally work ok.
Discovery is done only once per created account
(unless the discovery assistant is called manually),
so we should be fine here.
discoveryAssistant now delivers useful results.