API cleanup

Hi Christian, I've started to do a little cleanup of the control functions and the rest of the API. Function should be equivalent to the original, but hopefully a little less redundant :-)