Added caching

Port of symfony-cmf/RoutingAutoBundle#78
I find this line extremely difficuly to understand, I would prefer something more structured like the following:

````php
  $resolvedMetadata = null;
  
  // if there is cache
  if (null !== $this->cache) {
      $metadata = $this-loadClassMetadataFromCache($reflection);

      if ($metadata->isFresh) {
          $resolvedMetadata = $this->getCachedMetadata($reflection);
      } else {
          $resolvedMetadata = $this->loadMetadataForClass($class, $metadata, $addedClasses);

          if (null === $resolvedMetadata) {
              $resolvedMetadata = $this->resolveMetadata($class, null, $addedClasses);
          }

          if (null === $resolvedMetadata) {
              return null; // throw exception??
          }

          $this->putClassMetadataInCache($resolvedMetadata);
      }

      $this->resolvedMetadata[$class] = $resolvedMetadata;
  }

  return $this->resolvedMetadata[$class];
````