Use correct function when assembling cached form action

Replace the coefficient in the cached form action by the currently
passed in Function. Otherwise we'd keep using the Function from the
first call to _form_action.
Add note explaining efficiency gain of caching form action
Add test for Matrix form action