Restructure tests and make them testling compatible.