Added tests and beginning of paper