Auto-close open bbcode. Handles:

/*
 * Tests:
 * "[b][i]"              -> "i"
 * "[b][i][/i]"          -> "b"
 * "[b][/b]"             -> nil
 * "[url=foo]"           -> "url"
 * "[url=foo][b][i][/b]" -> "url"
 */

Open [code] tags trump inner markup:

/* Tests:
 * "[code] [b]"                -> TRUE
 * "[code] [b] [/code]"        -> FALSE
 * "[code] [b] [/code][code]"  -> TRUE
 * "[code=cpp] [b]"            -> TRUE
 * "[/code]"                   -> FALSE
 * "[codemonkey] [b]"          -> FALSE
 * "[code][codemonkey]"        -> TRUE
 */
Merge pull request #293 from shaver/autoclose-bbcode

Auto-close open bbcode.