Attempt to refactor native controls adding in the HTML5 tech

I tried to help with this to get it into the next release and got relatively far refactoring it to be cleaner. However now I'm getting intermittent errors on my iPhone, and I'm out of time to try and debug it. Hopefully this will at least give you some ideas to work from.