Moved to using smart pointers, cleaned up test, changed ifdefs to pragmas