Lua: Cache more stuff in memory

Cache wikibase.entity objects and the entity id belonging to
the current page in memory, so that we don't have to get them
from PHP this often.

Change-Id: I22d4f9d2fd1f01a9bfffde77d6c9c75842e28d9e