Same functionality but changed program structure

Added Polyglot class, getters, a bit of error treatment with exceptions
and etc