Add journal writing features and tests