Fix cryptobox and secretbox, add tests