Adding gson libs and refactoring inference package and code.

-Adding gson libs and javadoc
-Refactoring inference package. Moved the inference package to root
package.
-Refactoring the inference code. Created the method getDuration(...) in
InferenceUtils. This method calculate the duration spent on interval.