Support packages prefixed with their name

/cc @mitchellh 
Negative indicies always trip me up. Will this work no matter what the length of filename is? Since the parts switch for prefix or no.