Started implementation of fragment system, crash fixes