Adding maven build and unit tests

in order to build the jar file (which can simply be run using java -jar ...), you type:

mvn build

in the same directory as the pom.xml

Also added some unit tests for serialization (which are currently failing).