Ajax nodes tweaks

Performance tweaks when ajax-loading to reduce the number of DB queries Nodes#tree call.