Tests added. Ready for integration into master.