A bunch of fixes
Moved integration functions to a separated file, fixed maintenance