Refactor font loading code and add support for ArrayBuffers