Restructure everything into modules

Signed-off-by: Igor Popov <igor.popov89@gmail.com>