Moved shared/static library detection to separate module