improve extend and reference resolving

I need to `extend` refering seperate schema files a lot. So I fixed that.

eg. you want to define something like a custom type `german_phone_number` 

`types.json`
```json
{
  "description" : "custom type definitions",
  "type":"object",
  "german_phone_number" : {
  	"type": "string",
  	"pattern":"/^0049\\d{5,12}$/"
  }
}
```
...and use it in your other schemas like this:
```json
{
  "type":"object",
   "mobile_phone_number": {
     "extends" : "types.json#/german_phone_number",
     "required": true
   },
  "office_phone_number": {
     "extends" : "types.json#/german_phone_number",
     "required": true
   },
  "office_fax_number": {
     "extends" : "types.json#/german_phone_number",
     "required": false
   }
}
```
see `tests/fixtures/*` for a

Would be grate if this will make it to json-schema.
Ask me if you have questions.

Regards, Jan