convert serialize functions to return promises

convert serializers to return promises so they can call setTimeout to
allow the UI to do the work it needs to get done rather than blocking
the UI thread from refreshing the page (noticable for no-sql documents
which have a lot of objects)

TODO: fix the tests to accept promises