Add reader factory, improve tests