1. Refactored for increased modularity
2. added successful crossplatform interface detection.