Merge changes from old nanoc (up to 3699f734d1028f698be10caa13d8a1259d5aac2f)