Add cast for [NSApp delegate]

* (Also changed some outdated URLs)
* Replaced [NSApplication sharedApplication] with NSApp