Magic numbers fix

Most of magic numbers in code have been replaced with defines.
Merge pull request #16 from evmarkov/master

Magic numbers fix