Coalesced memory access for the update loyalties function.

Removed old headers, obsoleted functions.