Overall code reestructuration. 
Added lots of comments.
Added *.lo *.la *.exe to gitignore.