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

Copyright.