Make update fn much faster
* put save file fn in seperate thread
* memoize visibility fn
* compute some values once per tick

Fix npc-at-xy invocations argument order

Rework tick fn to make it simpler

Save the new-state rather than the old state so that save files are not
lagging by one tick

Add log-time macro for profiling