Core Stampy classes with some bug fixes and extra validation