Move C functions from GUI lib to main app lib

Read a curl buffer app/xml into xmldoc uncompressing if needed
Create a ref obj from char arr