Refactoring of h2e main module

2 jobs for python_2to3 in 50 seconds (queued for 3 seconds)