Compatibility

Fixed some compatibility problems, implemented new features, added some test html.