Use non-recursive algorithm for process_inlines.

Closes #187.