Move link encoding function and make it easier to call
Move link encoding function and make it easier to call

Just pass a VALUE (Ruby string) rather than a pointer and a length, and
move the function up near the top of the file where it can be used
without needing a forward declaration.

Signed-off-by: Wincent Colaiuta <c76ac2e9cd86441713c7dfae92c451f3e6d17fdc@wincent.com>

wincent/wikitext,wincent/wikitext,barnaclebarnes/wikitext,geni/wikitext,barnaclebarnes/wikitext,barnaclebarnes/wikitext,geni/wikitext,geni/wikitext