Add basic format and query function

The idea behind this PR is to replace the current format and bbp functions in the buffer by a new pointer datatype which represents a format and allows easier conversion.