Restructure packages and modules.
Move lib to separate module.
Update configurational files.