Changed the expansion logic to expand definitions into the proceeding element of whatever element the mention is contained within.

Signed-off-by: Jakob Brandsborg Ehmsen <jakobehmsen.github@gmail.com>