big clean up of #680 including working support for interfaces
finish tests for #680