Support for password inputs, without changing the type property

Browsers throw an error when changing the type property of an input after it has been created. So when it comes to password inputs the directive doesn't work (not sure why the tests don't catch this).

This fix creates a clone of the original element, changes it's type, and *then* appends it to the DOM.