runCommands added

Placed the main events loop into a function to allow for premature
returning, in the event that an item is required and not possessed.