Functional way to generate BEMJSON