Encapsulated the Flux Library removing all global variables, only introd...

Encapsulated the Flux Library removing all global variables, only introducing the global function flux.