Improved tests, implemented some features in DAL and higher layers.