More fully fleshed out class, implemented some tests.