Some basic clean-up

It's a first part of code clean-up and code convention implementation. The process if far from the completion, but I did this PR for the sake of readability.

P.S. The project extremely needed tests. @ignotur, could you, please, tell what tests (in first place, unit tests) conceptually could be implemented right now? I mean ideas that should be in tests, not code.