Added defcomponent.
Refactored component functions to accept record types.