Refactor i-glue to glue for bem-core (untested)