public static function expand(array $data, array $options = []) {
		$defaults = ['separator' => '.'];
		$options += $defaults;
		$result = [];

		foreach ($data as $key => $val) {
			if (strpos($key, $options['separator']) === false) {
				if (!isset($result[$key])) {
					$result[$key] = $val;
				}
				continue;
			}
			list($path, $key) = explode($options['separator'], $key, 2);
			$path = is_numeric($path) ? (integer) $path : $path;
			$result[$path][$key] = $val;
		}
		foreach ($result as $key => $value) {
			if (is_array($value)) {
				$result[$key] = static::expand($value, $options);
			}
		}
		return $result;
	}