Move database schema management into ruby libs