Changed list-like usage of tables to set-like

This can greatly improve performance of the library when there are lots
of buildings on the map. Kudos to github.com/oswynb for the idea!

Also changed how the AddUnit function works. No longer need to call that
function.