AppKit.php: fixed some bugs and NSImage/NSImageView

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
CoreDataBase.php: fixed issues with empty database path and quoting of identifiers

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
Foundation.php: fixed issues with NSUserDefaults if there is no login; improved error reporting

Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>