Dirty fix for pass by reference issues

the Stack class has been extended to be able
to handle registration of functions that
take/return const references to primitive
types or containers.