Removed dependency on client from project, pushed more logic into MataActiveRecord

Signed-off-by: Marcin Wiatr <mail.wichura@gmail.com>