added Chain class and implemented all but the Flush() method; changed NULL to nullptr everywhere; modified README.md