refactor transactions model/controller

Remove and refactored inefficient or unneeded functions.

Added validations to transaction_category/vendor to require presence of
transaction_id.

Moved csv_extract to its own file in the lib directory.