Added JWS SM signature for #5 and also cleaned up the code that checks for permissive SM's a bit.