Separate client and core

Alright, so I've moved to the client all code related to:
- the the in-memory DB
- ajax
- crud events on relations

Right now, records and fields still have event-related logic.