Refactor to use type-mapping instead of if/else cascade

This pull request changes the if/else cascade inside the value class to use a TypeMap:

```php
// Creation
$ctor= self::$types[typeof($value)];
return $ctor($value);
```