Add factories to get reader/writers, update tests