unoptimized plugin dependency sorting algo

Needs some failing test cases so I can fix any edge case errors.