improvements to pdo instantiation and encode handling
param replacement session handling