core: add option to compile without chat functionality

Use case: using the WeeChat project as a TUI from which to build non-chat / IRC utilities.