Re-design of libwapcaplet for performance