Rewritten the whole library using a more classic approach.

now we should be able to handle browser specific implementation easier. Added a lot case-documentation