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