Revert changes in registerLanguage

Now it only accepts a function, rather than both function and object.