Updated for compatibility with npm scoped packages

Again with the trailing whitespace trimming..! 

Here all that's happening differently is instead of splitting on '@' blindly it checks to see if the '@' is the first character or not. If it is, it's assumed that it's a scoped package but might contain another '@' for versioning.