plugins fix

SEARCH-738 Cleaned up in code

SEARCH-738 Fixed some bugs in plugin downloading

SEARCH-738 added credentials arg
Merge