Mimic GDI pen mgmt, fix line width and pen color issues, move to C++11/libc++