fix a few issues, mainly with the line tool

- decent undo command messages for lines
- fixed a repainting issue where not everything was repainted correctly
- stop line from painting outside the map and messing everything up
- made CMap::positionValid() accept a const point parameter