Fixed compile errors and added a bunch of unit tests for SalesforceSecurity library.

We could just fall back to the `key`/`existingKey` comparison here.  Either works though.