Large amounts of additional work done. Basic tests added.