nered 14 Newbie Poster

Hi,

Iam not new to magento but it's my first time developing a payment gateway,
extension for it. Magento is built on top of MVC framework so its extensions
aka. plug-ins or modules are built this way> Block, Controller, Module.

I have a sample code from the gateway provide on how their gateway works
the whole process is pretty simple so i need to know:

Can a magento extension use an additional libary.

Blocks are just viewer files iam interested more in module and controller
i have few blocks of code and i need to know where do i write my code.

Do i need controllers or can i make a frontend payment form in Blocks
and put all my var's and code in models?