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

Minor: this comment should probably be removed.  That check is going to be below (and already commented).