Refactored Codebase for UI Renderering Extensions.

    * Refactored codebase for Twig Extensions.
    * Added support for token swap during authentication.