Added tests skeleton for all needed tests. More CP testing.
Code clean up and formatting.