refactor excerpt generation

added new function nm_make_excerpt, called by nm_create_excerpt, also to
be used elsewhere