Undefine a symbol and its associated entry in the symbol cache

1. Undefine the symbol from both the table and cache
2. Refactor undefine symbol into a function
3. function redef testcase