Updates to get the tests working with gcc's native TR1 lib + Misc bug fixes, and changes to ensure std conformity.