Changes to design to handle documents

#9