Fixed error in database and cleaned up edit and add layouts

Database tools had two fields reversed, fixed that. Edit and add layouts
were unorganized, changed them to linear layouts because it seemed more
appropriate for the form-like layouts.