replace INBOUNDS macro with inbounds function

make inbounds const, add wrapper for tripoint
move call to map::build_map_cache outside of game::draw_ter

Instead of calling it (which will take a long time with z-levels) from draw_ter, call it before calling draw_ter.

In some places a call to build_map_cache is not needed at all!