Add potentially missing include, add check and use unique_ptr when avail

right now the c preprocessor check for c++11 unique_ptr requires 201103, although it was available prior to that version, seems like the safest check to use for now...