Added generic PKI_MEM_[en|de]code() interface. Improved URL encoding performances. Fixed misc bugs.