NSBundle: better support of OSX (bad implementation though, needs refactoring)