Added a before_method function and a before_output function

Added the option to customize the keys table for each of the functions and the key_row etc.. Added a fetch_key function and an iskey_valid_function