Added Mutex and moved tests

Multiple tasks trying to access NSS should now properly only init it
once.

Also moved tests to their own module as part of reorg.