Added InputStream-based constructor and callback upon document change