Added unittests to SConstruct
Improved track detection and added test cases