Add postFrame

postFrame runs at the end of the frame and is mainly to remember certain
variables so that update can check for any changes between frames.