Nest <code> in <pre> as per markdown spec.
Pull out code processing and fix a reversing bug.
Instead of reversing, use shift() and unshift().