More extensible optimization function names
Less hideous code

This should enable better error handling and make it /much/ easier to
add data types