Add check for running map_get on empty map

Prevents an error when you use map_get on a map which is empty
Add CMakeLists.txt for use in my build
Remove trailing spaces