Redesign of lib

Redesigned lib and added command line tool to measure energy consumption of a program