Modularized stuff. Added registars class and implemented a real database