Refactored the code, removed void pointer arithmetic, and fixed invalid list removal after freeing of memb object.
Refactored the code, removed void pointer arithmetic, and fixed invalid list removal after freeing of memb object.

arurke/contiki,MohamedSeliem/contiki,arurke/contiki,bluerover/6lbr,arurke/contiki,bluerover/6lbr,bluerover/6lbr,MohamedSeliem/contiki,bluerover/6lbr,MohamedSeliem/contiki,MohamedSeliem/contiki,arurke/contiki,MohamedSeliem/contiki,bluerover/6lbr,arurke/contiki,MohamedSeliem/contiki,MohamedSeliem/contiki,arurke/contiki,bluerover/6lbr,bluerover/6lbr,arurke/contiki