public static function reflectionInstance($classname, $arguments = [], $set_remaining = FALSE, $set_include = FALSE, $set_exclude = FALSE) {
        $reflection = new ReflectionClass($classname);
        if(!$constructor = $reflection->getConstructor()) {
            return new $classname;
        }

        $args = self::getReflectionArgs($constructor, $arguments, $missing);

        if($missing) {
            $parts = [];
            foreach($missing as $key => $name) {
                $parts[] = "'$name' (or '$key')";
            }
            $missing = implode(", ", $parts);
            throw new Exception("Can not create object of type '$classname'. Argument $missing needs to be set.");
        }

        $instance = $reflection->newInstanceArgs($args);

        if($set_remaining) {
            foreach($arguments as $key => $value) {
                if(is_array($set_include) && !in_array($key, $set_include)) {
                    continue;
                }

                if(is_array($set_exclude) && in_array($key, $set_exclude)) {
                    continue;
                }

                $instance->$key = $value;
            }
        }

        return $instance;
    }