Add PEM import / export functions and tests.