Updating PLAIN framework

Added pipelining support and db, update tests.