This PR targets version 1.4. It may need changes for it to be compatible with the dev version.
It also includes extra functionality i.e adding cache tags to the render array.