Escape ', and some tidying/docs