Smart Pointers support (see enhancement #194)

Basic smart pointers implementation.

I also added a version of NQueens using the smart pointer support and a basic unit test (which I am not totally sure if it is done correctly).
This is a leftover code from an early version I forgot to change. As you can see, the `getNumRefs()` method above is doing exactly what you suggested.