Improved testing, added session support