Add updatesizehints() and entity location.

The locate() functions may be reused by each other, and with some sane
checks, we actually don't need to worry about performance too much.