Support formats like "some-leading-text-before-formatting-characters%Y-%m-%d"

With the current HEAD, stftime.Format("some-leading-text%Y-%m-%d", t) ends up with a redundant percent sign like "%some-leading-text2014-09-16". In addition, it doesn't handle escaped percent signs ("%%").  This patch fixes those problems.