Reimplemented Deferred to satisfy CommonJS Promise/A spec
Fixed a dead loop when config.notFoundLocation is incorrected configured
Fixed code style