Merge remaining Zentyal changes to openchange master and gets everything sync'ed

Please use new-style classes (derive from "object").