Major rewrite enroute to version 2.0