Modularisation

- moved sizeof to global
- added "view" and "sync" modules
- moved views from intersection.js to its own module