fix ability to build with swig testing out of tree
add conditional compile options and optional tests