Rewrite Majek's core using TDD