Give different types of section functions unique scopes

This allows you to target them for styling purposes for instance, etc.
Don't include whitespace when matching %!TEX options

This ensures we get only the intended value without any of the surrounding whitespace and line ending characters. Fixes #49, thanks to @inz for the pointer to the cause.
Citation Based on Current Word: Correct typo
Allow variables to be used in a \footnote{} function

Thanks to Andreas Löffler.