add picojson to 3rdparty library
update terminal detection

rotate model and calculate num of inliers
update to latest detection code
tiny bugfix
fix lots of bugs in test code