Erlang implementation of core chess types and rules