Refactor and document io file

Reduced write_record_list() and write_abstracts() to a single function
with support for outputting as markdown and custom line start strings