Implement support of the new context menu API

Starting with atom/atom#3658, a new API allow to make context menu display dynamic.