Short-range and medium-range order in solid and molten metaphosphate glasses