Made the codec API more flexible by making all functions global until outright stated at the end of the program. After that the API returns the functions in a table for other ways of loading the API.