adding syntax support for externally defined distributions and functions

@cberzan @jxwuyi @datang1992 @tejasvsrinivasan