Fix 251: Improve error handling

Fix #251

TODO:
- [ ] Update README;
- [ ] Get rid of the human readable messages on minifieds;
- [ ] Custom error assertion checking error object attributes see `https://github.com/jquery/globalize/pull/268/#discussion_r13909859`;
- [ ] Fix cldrjs entry on bower.json;

### What has been done?

This PR standardize error handling throughout Globalize. All errors thrown (by Globalize) are an instance of Error. They define a message and a code attribute. It may also define more attributes as shown below.

Four different kind of errors are handled:

- `E_DEFAULT_LOCALE_NOT_DEFINED`

Thrown when any static method, eg. `Globalize.formatNumber()` is used prior to setting the Global locale with `Globalize.locale( <locale> )`. Error object attributes: code.

- `E_MISSING_PARAMETER`

Thrown when a required parameter is missing on any static or instance methods. Error object attributes: code and name (containing the name of the missing parameter).

- `E_INVALID_PAR_TYPE`

Thrown when a parameter has an invalid type on any static or instance methods. Error object attributes: code, expected (expected type, eg. Number), name (parameter name), value (parameter passed value).

- `E_INVALID_PAR_VALUE`

Thrown for certain parameters when the type is correct, but the value is invalid. Currently, the only parameter with such validation is the date format (for either format and parse). Format allows [certain variants](https://github.com/jquery/globalize/blob/master/doc/api/date/format.md#parameters), if it's none of them, error is thrown. Error object attributes: code, value (parameter passed value).

- `E_MISSING_CLDR`

Thrown when any required CLDR item is not found. Error object attributes: code, path (CLDR item path not found).

### How does it fix 251?
 
**1) Throw error when default locale isn't set  (on all modules)**

Example:

```
> Globalize.formatNumber(4)
Error: E_DEFAULT_LOCALE_NOT_DEFINED: Default locale has not been defined.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validate (/tmp/node_modules/globalize/dist/globalize.js:142:9)
    at validateDefaultLocale (/tmp/node_modules/globalize/dist/globalize.js:150:2)
    at Function.Globalize.formatNumber.Globalize.formatNumber (/tmp/node_modules/globalize/dist/globalize/number.js:839:2)
    at repl:1:12
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
```

Error object:

```
{
  "code": "E_DEFAULT_LOCALE_NOT_DEFINED"
}
```


**2) Throw error on missing parameter (on all modules)**

All parameters of all public API methods are validated for presence. Example:
```
> Globalize.formatNumber()
value: E_MISSING_PARAMETER: Missing required parameter `value`.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validate (/tmp/node_modules/globalize/dist/globalize.js:142:9)
    at validatePresence (/tmp/node_modules/globalize/dist/globalize.js:150:2)
    at Function.Globalize.formatNumber.Globalize.formatNumber (/tmp/node_modules/globalize/dist/globalize/number.js:831:2)
    at repl:1:12
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
```

Error object:

```
{
  "code": "E_MISSING_PARAMETER",
  "name": "value"
}
```

**3) Throw error on invalid parameter type (on all modules)**

All parameters of all public API methods are validated for correct type. Example:
```
> Globalize("en").formatNumber("4")
value: E_INVALID_PAR_TYPE: invalid `value` parameter (4). Number expected.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validate (/tmp/node_modules/globalize/dist/globalize.js:142:9)
    at validateType (/tmp/node_modules/globalize/dist/globalize.js:159:2)
    at validateTypeNumber (/tmp/node_modules/globalize/dist/globalize/number.js:41:2)
    at Globalize.formatNumber.Globalize.formatNumber (/tmp/node_modules/globalize/dist/globalize/number.js:832:2)
    at repl:1:18
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
```

Error object:

```
{
  "code": "E_INVALID_PAR_TYPE",
  "expected": "Number",
  "name": "value",
  "value": "4"
}
```

**4) Throw error on the lack of likelySubtags (on locale initialization)**

```
> Globalize("en")
Error: E_MISSING_CLDR: Missing required CLDR content `supplemental/likelySubtags`.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validateCldr (/tmp/node_modules/globalize/dist/globalize.js:130:10)
    at validateLikelySubtags (/tmp/node_modules/globalize/dist/globalize.js:204:9)
    at new Globalize (/tmp/node_modules/globalize/dist/globalize.js:227:2)
    at Globalize (/tmp/node_modules/globalize/dist/globalize.js:219:10)
    at repl:1:2
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
```

Or

```
> Globalize.locale("en")
Error: E_MISSING_CLDR: Missing required CLDR content `supplemental/likelySubtags`.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validateCldr (/tmp/node_modules/globalize/dist/globalize.js:130:10)
    at validateLikelySubtags (/tmp/node_modules/globalize/dist/globalize.js:204:9)
    at Function.Globalize.locale (/tmp/node_modules/globalize/dist/globalize.js:261:3)
    at repl:1:12
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
```

Error object in both cases:

```
{
  "code": "E_MISSING_CLDR",
  "path": "supplemental/likelySubtags"
}
```

**5) Throw error on the lack of any needed date fields - main or supplemental data (on data module)**

An example validating a main path:
```
> Globalize("en").formatDate(new Date(), "d")
Error: E_MISSING_CLDR: Missing required CLDR content `main/en/dates/calendars/gregorian/dateTimeFormats/availableFormats/d`.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validateCldr (/tmp/node_modules/globalize/dist/globalize.js:130:10)
    at Globalize.formatDate.Globalize.formatDate (/tmp/node_modules/globalize/dist/globalize/date.js:1208:9)
    at repl:1:18
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)
```

Error object:

```
{
  "code": "E_MISSING_CLDR",
  "path": "main/en/dates/calendars/gregorian/dateTimeFormats/availableFormats/d"
}
```

An example validating a supplemental path:

```
> Globalize("en").formatDate(new Date(), {pattern:"e"})
Error: E_MISSING_CLDR: Missing required CLDR content `supplemental/weekData/firstDay/001`.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validateCldr (/tmp/node_modules/globalize/dist/globalize.js:130:10)
    at Globalize.formatDate.Globalize.formatDate (/tmp/node_modules/globalize/dist/globalize/date.js:1208:9)
    at repl:1:18
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)
```

Error object:

```
{
  "code": "E_MISSING_CLDR",
  "path": "supplemental/weekData/firstDay/001"
}
```

**6) Throw error on the lack of any needed number fields (on number module)**

```
> Globalize("en").formatNumber(5)
Error: E_MISSING_CLDR: Missing required CLDR content `main/en/numbers/defaultNumberingSystem`.
    at createError (/tmp/node_modules/globalize/dist/globalize.js:114:10)
    at validateCldr (/tmp/node_modules/globalize/dist/globalize.js:130:10)
    at Globalize.formatNumber.Globalize.formatNumber (/tmp/node_modules/globalize/dist/globalize/number.js:845:9)
    at repl:1:18
    at REPLServer.self.eval (repl.js:110:21)
    at Interface.<anonymous> (repl.js:239:12)
    at Interface.EventEmitter.emit (events.js:95:17)
    at Interface._onLine (readline.js:202:10)
    at Interface._line (readline.js:531:8)
    at Interface._ttyWrite (readline.js:760:14)
```

Error object:

```
{
  "code": "E_MISSING_CLDR",
  "path": "main/en/numbers/defaultNumberingSystem"
}
```

Ideally, all assistant-errors could be easily removed on minification to save bytes.

OBS: On every validation, include the respective value to the error message (make debugging it slightly easier).
> It sounds like you could simplify by moving the proper error messages to Cldrjs anyway

Do we want missing CLDR errors to be thrown this way [1] on Globalize or anything [2] is good enough?

On Globalize, the code responsible for formatting messages are already in-place. As we can see in cfaece5af1bc0eb15b4dc5b19788c492e476dde4, it's used not only for error messages, but for other key areas in Globalize. I think this code should not be duplicated in cldr.js. So, the error messages there are formatted in a [simpler manner](https://github.com/rxaviers/cldrjs/blob/b0.3.6/src/common/create_error.js#L15).

If we think the cldr.js error is already good/descriptive enough, we could remove the `try catch`s.

1: Examples of missing CLDR errors on Globalize can be seen on items 3 and 4 of the [description](https://github.com/jquery/globalize/pull/268).

2: Example of missing CLDR errors on cldr.js can be seen [here](https://gist.github.com/rxaviers/ffd019c47804b15ace48).