fix some namespace stuff

this removes some namespacing related errors preventing me from compiling on macosx 10.9

cherry-picked from the dogecoin repo: https://github.com/dogecoin/dogecoin/pull/2/commits and tested under 10.9 and ubuntu 13.10, should be safe