Added functions for Compiler and Context modularity. Fixed memory leak.