fix some bugs with new capability code
remove nlri api and replace it with extensive (and hopefully fix bug reported in issue 137)